package io.renren.modules.ypgl.service.impl;

import org.apache.commons.lang.StringUtils;
import org.springframework.stereotype.Service;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import io.renren.common.utils.PageUtils;
import io.renren.common.utils.Query;

import io.renren.modules.ypgl.dao.YaopinxinxiDao;
import io.renren.modules.ypgl.entity.YaopinxinxiEntity;
import io.renren.modules.ypgl.service.YaopinxinxiService;


@Service("yaopinxinxiService")
public class YaopinxinxiServiceImpl extends ServiceImpl<YaopinxinxiDao, YaopinxinxiEntity> implements YaopinxinxiService {


    @Override
    public PageUtils queryPage(Map<String, Object> params) {

        String shengchanriqi=(String)params.get("shengchanriqi");
        String yaopinming=(String)params.get("yaopinming");
        String qiyemingcheng=(String)params.get("qiyemingcheng");

        IPage<YaopinxinxiEntity> page = this.page(
                new Query<YaopinxinxiEntity>().getPage(params),
                new QueryWrapper<YaopinxinxiEntity>()
                .ge(StringUtils.isNotBlank(shengchanriqi),"shengchanriqi",shengchanriqi)
                .le(StringUtils.isNotBlank(shengchanriqi),"shengchanriqi",shengchanriqi)
                .like(StringUtils.isNotBlank(yaopinming),"yaopinming",yaopinming)
                .like(StringUtils.isNotBlank(qiyemingcheng),"qiyemingcheng",qiyemingcheng)
        );

        return new PageUtils(page);
    }

}
